<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试正则表达式</title>
</head>
<body>
<h1>正则表达式</h1>
<script>
    // let str = "Hello JavaScript";
    // // let reg = new RegExp("j","i");
    // let reg = /j/i;
    // let result = str.match(reg);
    // console.log(result);
    let telNo = "020";
    let pattern = /^1[0,1]\d$|^\d\d$|^120$|^0\d\d$/;

    console.log(pattern.test(telNo));
</script>
</body>
</html>